Filter hook 'pre_term_{$field}'

in WP Core File wp-includes/taxonomy.php at line 1827

View Source

pre_term_{$field}

Filter Hook
Description
Filters a term field value before it is sanitized. The dynamic portion of the hook name, `$field`, refers to the term field.

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Filter
Line Number 1827

Hook Parameters

Type Name Description
mixed $value Value of the term field.
string $taxonomy Taxonomy slug.

Usage Examples

Basic Usage
<?php
// Hook into pre_term_{$field}
add_filter('pre_term_{$field}', 'my_custom_filter', 10, 2);

function my_custom_filter($value, $taxonomy) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/taxonomy.php:1827 - How this hook is used in WordPress core
<?php
1822  		 * @since 2.3.0
1823  		 *
1824  		 * @param mixed  $value    Value of the term field.
1825  		 * @param string $taxonomy Taxonomy slug.
1826  		 */
1827  		$value = apply_filters( "pre_term_{$field}", $value, $taxonomy );
1828  
1829  		/**
1830  		 * Filters a taxonomy field before it is sanitized.
1831  		 *
1832  		 * The dynamic portions of the filter name, `$taxonomy` and `$field`, refer

PHP Documentation

<?php
/**
		 * Filters a term field value before it is sanitized.
		 *
		 * The dynamic portion of the hook name, `$field`, refers to the term field.
		 *
		 * @since 2.3.0
		 *
		 * @param mixed  $value    Value of the term field.
		 * @param string $taxonomy Taxonomy slug.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.